
/**
 * AppleIIGo
 * Internal SmartPort 2 IWM class
 * (C) 2007-2008 by Marc S. Ressl (mressl@umich.edu)
 * Released under the GPL
 */

#ifndef INTERNALSMARTPORT2IWM_H
#define INTERNALSMARTPORT2IWM_H

#include "IWM.h"

#define DISKREGISTER_DRIVE35	(1 << 6)
#define DISKREGISTER_HEAD1		(1 << 7)

class InternalSmartPort2IWM : public IWM {
public:
	InternalSmartPort2IWM(class Motherboard * motherboard,
						  char * slotDeviceName);
	
	void onDevicesConnected();
	void onResetAsserted(bool isRestart);
	
	void writeIo(UINT16 address, UINT8 value);
	UINT8 readIo(UINT16 address);
	
	UINT8 readMemory(UINT16 address);
	
private:
	class MMU * mmu;
	
	UINT8 diskRegister;
	
	void setDiskRegister(UINT8 value);
	UINT8 getDiskRegister();
};

#endif
